package com.sport.common.web.model;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

@Schema(description = "分页请求入参")
public class PageParams<T> {

    // 当前页数
    @Setter
    @Schema(description = "页码")
    private int currentPage;
    // 分页大小
    @Setter
    @Schema(description = "页面大小")
    private int pageSize;
    // 分页数据
    @Setter
    @Getter
    @Schema(description = "请求参数")
    private T params;

    /**
     *  返回当前分页对象
     * @return
     */
    @Schema(hidden = true)
    public Page<T> getPage(){
        return new Page<>(currentPage,pageSize);
    }

}
